#include <iostream>
#include <vector>
using namespace std;

int n,a,n1 = 0,n2 = 0;
struct Node{
    int data;
    struct Node *l,*r;
    Node(int d):data(d),l(NULL),r(NULL){}
};

void insert(Node *&root,int d){
    if(root==NULL){
        root = new Node(d);
        return;
    }
    if(d<=root->data)    insert(root->l,d);
    else    insert(root->r,d);
}

signed main()
{
    cin>>n;
    Node *root = NULL;
    for(int i=0;i<n;i++){
        cin>>a;
        insert(root,a);
    }
    vector<Node*> v,t;
    v.push_back(root);
    while(v.size()){
        t.clear();
        swap(n1,n2);
        n1 = v.size();
        for(int i=0;i<v.size();i++){
            if(v[i]->l)    t.push_back(v[i]->l);
            if(v[i]->r)    t.push_back(v[i]->r);
        }
        v = t;
    }
    printf("%d + %d = %d",n1,n2,n1+n2);
    return 0;
}
